UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0TKYT5LKFExaMcr8me485SZf42Qoi8tY0DQuN0pSsNU=' 
WHERE 
  key_id = '43dc16ecd2725fdbce7486aef9b723b1f38d25c4bdba327a1cff11d77a07570b' 
  AND (
    token = '0TKYT5LKFExaMcr8me485SZf42Qoi8tY0DQuN0pSsNU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027