UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p0DErFrzf98nzmcepOrBQBSPk/NLs6TcLj+bWdVLYCY=' 
WHERE 
  key_id = '853e478984ae715b5c38e638cc3893c6e0e85d45da03517537c3c95af283a643' 
  AND (
    token = 'p0DErFrzf98nzmcepOrBQBSPk/NLs6TcLj+bWdVLYCY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029