UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RAZlDgj8FZB8elYHAyB9K4R+mT0ap0cJll/M2ko1D70=' 
WHERE 
  key_id = '4fe8fcee9e4ef0728fbfd4ad9d9e31508c18c531624965d71e1fc9154cdb5425' 
  AND (
    token = 'RAZlDgj8FZB8elYHAyB9K4R+mT0ap0cJll/M2ko1D70=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031