UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1rBlpexcIE8cjKCTOC6f51De+yiETuyzaHKqyGZhvpc=' 
WHERE 
  key_id = 'f09c7199e584ad4133a33f22a40c4a080661065d2e0bcb11fef9e5a74232fbab' 
  AND (
    token = '1rBlpexcIE8cjKCTOC6f51De+yiETuyzaHKqyGZhvpc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033