UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eZR1vk/guO76N6Hm/cjYESk+STzuuBVqHtTwEcI/+Uw=' 
WHERE 
  key_id = '0035e285c56287ed657c1f47f7fb07fafd77cc36e2ae45b0a3dbe0a5cf1b6eab' 
  AND (
    token = 'eZR1vk/guO76N6Hm/cjYESk+STzuuBVqHtTwEcI/+Uw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038