UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MfAilqdpw/FLwyboKJmFIc2Qx6OBJ2QcpOZw4SmYuOI=' 
WHERE 
  key_id = '460bc4037c67450c31ba2e36c15346751504af08234a4d436c8d1d246c9829a1' 
  AND (
    token = 'MfAilqdpw/FLwyboKJmFIc2Qx6OBJ2QcpOZw4SmYuOI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019