UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fjF/gLkFDNIkMtCJ9Lzq7a/yey2+AjDmh/2q3JOsNTg=' 
WHERE 
  key_id = '07ffd50da2e30773f78c8206ff3aabf71e6c8ac87e22c41bff266debeedab6e6' 
  AND (
    token = 'fjF/gLkFDNIkMtCJ9Lzq7a/yey2+AjDmh/2q3JOsNTg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029