UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3rV30uSMbTC2/PQf6qZrzu7BTJNCJO8zvNAEUoBODHQ=' 
WHERE 
  key_id = '090918298e6635a566e3088de32d386d5a6dcd7ecb84a7b1a6e547baee1bfc50' 
  AND (
    token = '3rV30uSMbTC2/PQf6qZrzu7BTJNCJO8zvNAEUoBODHQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036