UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YclbUbZZUnyvzWE+YfZabG2TdXeROmdCuaUVj4ArMcY=' 
WHERE 
  key_id = 'bd11d7c18aa1106e2bbb9639ec0ef9b061dd7d14aa7d0e95c024681f90bc0a75' 
  AND (
    token = 'YclbUbZZUnyvzWE+YfZabG2TdXeROmdCuaUVj4ArMcY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028