UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JailSSKXJXENsBmVsEtxft4cp8zh0njFqPPl+Xb9GG0=' 
WHERE 
  key_id = '563ea9bd4eb4e5c527ee6235721e6c9df0dd4b39c1dcb00593cc183e40e41a93' 
  AND (
    token = 'JailSSKXJXENsBmVsEtxft4cp8zh0njFqPPl+Xb9GG0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045