UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PKAWV0U7/0qulXwoKY0ykLNh+Jk+bBLuJWYvUJOCr5g=' 
WHERE 
  key_id = '5c9be677d3f1069fe2197f61885b5b21893f0fa91d32c198dfc5db66bc1ab250' 
  AND (
    token = 'PKAWV0U7/0qulXwoKY0ykLNh+Jk+bBLuJWYvUJOCr5g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029