UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PTMf/53NOTRHh6t+JQet4K8zN4tk4YD2JCJvC7ggrZQ=' 
WHERE 
  key_id = 'ceba09be4b321cccb7e074c27c9ea81d3dd37df029fdb8db8e354159ec2240b9' 
  AND (
    token = 'PTMf/53NOTRHh6t+JQet4K8zN4tk4YD2JCJvC7ggrZQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018