UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2B/lFISlg4smL8AaUfafPCa/3G8uDoQpTsSDcvHK5FI=' 
WHERE 
  key_id = '1c46e56afcba3626691f08440b66027aa1f7ca4800eea245f3f17bcc662ce05b' 
  AND (
    token = '2B/lFISlg4smL8AaUfafPCa/3G8uDoQpTsSDcvHK5FI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031