UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wk/bED5/B+4XBaHJA3zn5J11Yx17FiIQMb1GEZ4a87E=' 
WHERE 
  key_id = 'fc56b9fd828d2aea6325b053490b0eda7f4b8ffe81cd2bc061a967d26c08e450' 
  AND (
    token = 'Wk/bED5/B+4XBaHJA3zn5J11Yx17FiIQMb1GEZ4a87E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043